import type { RouteRecordRaw } from 'vue-router'

export const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: () => import('@/views/layout/index.vue'),
    name: 'Home',
    redirect: '/home',
    children: [
      {
        path: 'home',
        component: () => import('@/views/home/index.vue'),
        name: 'Homepage',
        meta: {
          title: '首页',
        },
      },
    ],
  },
  {
    path: '/login',
    component: () => import('@/views/login/index.vue'),
    name: 'Login',
    meta: {
      isAuth: false,
      title: '登录',
      hidden: true,
    },
  },
  {
    path: '/books',
    component: () => import('@/views/layout/index.vue'),
    name: 'books',
    children: [
      {
        path: 'management',
        component: () => import('@/views/booksManagement/index.vue'),
        name: 'booksManagement',
        meta: {
          isAuth: false,
          title: '图书管理',
          hidden: false,
        },
      },
    ],
  },
  {
    path: '/redirect/:path*',
    component: () => import('@/views/redirect/index.vue'),
    name: 'redirect',
    meta: {
      title: 'redirect',
      keepAlive: false,
      hidden: true,
    },
  },
  {
    path: '/404',
    component: () => import('@/views/404/404V2.vue'),
    meta: {
      title: '404',
      keepAlive: false,
      hidden: true,
    },
  },
]
